Jason Hudgins

Jason Hudgins

12p

8 comments posted · 6 followers · following 0

11 years ago @ a blog called foo - HTTP Connections revis... · 0 replies · +1 points

In theory you should only call this method once to instantiate an HttpClient instance, at which point you should save a reference to it and pass that around as needed.

But you're right, in the previous example it was using the singleton model, and you'd have only one single instance shared globally. While that might sound great at first, it's actually inflexible and somewhat dangerous. For example, imagine you were using a single global instance and someone unknowingly called HttpClient.getClientConnectionManager().shutdown(). Or if you needed multiple HttpClient instances because they each required different settings, in the SchemeRegistry or what not.

11 years ago @ a blog called foo - HTTP Connections revis... · 0 replies · +1 points

Looks like something is wrong with pastie.org, updated to use gist.

13 years ago @ a blog called foo - The limitations of Asy... · 0 replies · +1 points

Sounds like it will be an interesting post, looking forward to reading it...

13 years ago @ a blog called foo - The limitations of Asy... · 0 replies · +1 points

If I understand your scenario, it sounds like you just need a single thread looping, so you could probably use an AsyncTask here without much trouble. If there is no UI interaction, I might consider it overkill though, just a normal Thread object could suffice. Without knowing more about what your app is doing it's hard to give more specific advice. Either way, the most important thing to remember is to tear down your thread/task when your Activity is torn down and then resume it on the other side. Look here: http://code.google.com/p/shelves/source/browse/tr... for a good example of how to do this.

13 years ago @ a blog called foo - HTTP Connections revis... · 0 replies · +1 points

The HttpClient instance is not static, the method is static because it's part of my HttpUtils.java class, which is not obvious since I didn't paste the entire file.

14 years ago @ a blog called foo - HTTP connection reuse ... · 0 replies · +1 points

Thanks for pointing that out, I've revisited this and other issues in a more recent post : http://foo.jasonhudgins.com/2010/03/http-connecti...

14 years ago @ a blog called foo - Building location awar... · 0 replies · +1 points

The tutorial was last updated on July 25th of this year, it for sure should work with 1.5, and probably 1.6 as well. The source is available via svn here : http://code.google.com/p/trivial-gps/source/check...

15 years ago @ Texas Startup Blog - Our expansion and how ... · 0 replies · +1 points

Could we organize an all night hackathon, like the SuperHappyDevHouse (http://superhappydevhouse.org/) ? Not sure if that would fly with the infomart security (having people in and out of the building all night), but it'd be fun.